<template>
	<view class="">
		<view class="u-page">
			<u--form
				labelPosition="left"
				:model="model1"
				ref="form1"
				class="form"
				v-for="(item, index) in res.data" :key="index"
			>
				<u-form-item
					label="姓名"
					class="formItem"
					labelWidth="150rpx"
					style="font-weight: bold;"
					borderBottom
					ref="item1">
					<u--text 
					 type="error" 
						:text="item.staffName">
					</u--text>
				</u-form-item>
				<u-form-item
					label="全部业绩"
					class="formItem"
					labelWidth="150rpx"
					borderBottom
					ref="item1">
					<u--text 
						type="info"
						:text="item.allAchievements">
					</u--text>
				</u-form-item>
				<u-form-item
					label="项目业绩"
					class="formItem"
					labelWidth="150rpx"
					borderBottom
					ref="item1">
					<u--text 
						type="info"
						:text="item.allProjectsAchievements">
					</u--text>
				</u-form-item>
				<u-form-item
					label="销售业绩"
					class="formItem"
					labelWidth="150rpx"
					borderBottom
					ref="item1">
					<u--text 
						type="info"
						:text="item.allSaleAchievements">
					</u--text>
				</u-form-item>
				<u-form-item
					label="可用提成"
					class="formItem"
					labelWidth="150rpx"
					borderBottom
					ref="item1">
					<u--text 
						type="info"
						:text="item.availableCommission">
					</u--text>
				</u-form-item>
				<u-form-item
					label="项目提成"
					class="formItem"
					labelWidth="150rpx"
					borderBottom
					ref="item1">
					<u--text 
						type="info"
						:text="item.projectsCommission">
					</u--text>
				</u-form-item>
				<u-form-item
					label="销售提成"
					class="formItem"
					labelWidth="150rpx"
					borderBottom
					ref="item1">
					<u--text 
						type="info"
						:text="item.saleCommission">
					</u--text>
				</u-form-item>
				<u-form-item
					label="已结算提成"
					class="formItem"
					labelWidth="150rpx"
					borderBottom
					ref="item1">
					<u--text 
						type="info"
						:text="item.settledCommission">
					</u--text>
				</u-form-item>
				
			</u--form>
		</view>
	</view>
</template>

<script>
	import { formatDate } from '@/common/utils/commonHelper.js'
	import listHeightMixin from '@/common/computedAltitude.js'
	export default {
		mixins:[listHeightMixin],
		data() {
			return {
				keyword: '',
				dataId:0,
				res: {},
			}
		},
		
		onLoad() {
			if(this.id!==undefined){
				this.dataId = this.id;
			}
			this.getData(this.dataId);
		},
		methods: {
			scrolltolower() {
				console.log('pages')
			},
			getData(id){
				var that = this;
				if(id===undefined){

				}else{
					that.$reqPost('StaffDataSummaryList',{ page:1, limit:20,staffId:id }).then(res=>{
						that.$data.res = res;
					})
				}
			},
			formattedDate(value,format){
				return formatDate(value,format);
			}
		}

	}
</script>

<style lang="scss" scoped>
	.search-box {
		padding: 20rpx;
		background-color: #fff;
	}
	.u-page{
		background-color:#fff;
		padding: 20rpx;
	
	}
	.form{
		width: 100%;
		.formItem{ padding-left: 50rpx;}
	}
	
</style>
